package com.packtpub.esh.historywords2hdfs;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @author ChangLiang
 * @date 2018/8/10
 */
public class MyMapper extends Mapper<Writable, Writable, NullWritable, Text> {

    @Override
    protected void map(Writable key, Writable value, Context context) throws IOException, InterruptedException {
        Text text = new Text();
        text.set(value.toString());
        context.write(NullWritable.get(), text);
    }
}
